package com.bcqn.dao;

import com.bcqn.model.PostCollection;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface PostCollectionMapper {
    /**
     * 插入收藏信息
     * @param postCollection
     * @return
     */
    int insert(PostCollection postCollection);

    /**
     * 更新收藏信息
     * @param id
     * @param status
     * @return
     */
    int update(@Param("id") Long id, @Param("status") Integer status);

    /**
     * 根据userId和postId查询收藏信息
     * @param postId
     * @param userId
     * @return
     */
    PostCollection getByPostIdAndUserId(@Param("postId") Long postId, @Param("userId") Long userId);
}